package T03_事务的ACID及4种隔离级别.H02_codeTr.测试是否是同一个连接;

import T03_事务的ACID及4种隔离级别.H02_codeTr.Utils.JDBCUtils;
import org.junit.jupiter.api.Test;

import java.sql.Connection;

/**
 * @author lucky monkey
 * @version 1.0
 * @date 2022-06-01 11:15
 */
public class Test01 {

    @Test
    public  void  ceshi01() throws Exception {
         Connection connection1= JDBCUtils.getConnection();
         System.out.println(connection1.hashCode());

         Connection connection2=JDBCUtils.getConnection();
         System.out.println(connection2.hashCode());

         System.out.println(connection2==connection1);
    }
    @Test
    public  void  ceshi02() throws Exception {
        Connection connection03=JDBCUtils.getConnection();
        System.out.println(connection03.hashCode());
        Connection connection04=JDBCUtils.getConnection();
        System.out.println(connection04.hashCode());
    }

    @Test
    public  void  ceshi03() throws Exception {
        Connection connection=JDBCUtils.getConnection();
        System.out.println(connection.hashCode());
    }
}
